This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2000-293631, filed Sep. 27, 2000, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to a device for coding a digital moving picture video signal and more specifically to a device and method for coding a video signal in a predetermined coding format through the use of an improved method of updating the quantization scale factor.
2. Description of the Related Art
In general, an encoder for coding a video signal, i.e., a moving picture signal, must be arranged to code the video signal in a predetermined format, partition the coded signal into units of a predetermined amount of coded data, and output the resulting bitstream. That is, in order to prevent the occurrence of overflow or underflow at a buffer at the bitstream receiving end, the encoder is required to control the amount of coded data generated in the bitstream.
One of methods for preventing the overflow and underflow is to control the quantization scale factor. The quantization scale factor refers to a factor used for quantizing DCT (Discrete Cosine Transform) coefficients. In an encoding process, one frame of video signal input to the encoder is divided into a number of blocks. Each block is orthogonal-transformed through DCT process to obtain a set of DCT coefficients. The DCT coefficients are quantized based on the quantization scale factor. In general, the amount of generated coded data and the quantization scale factor are inversely proportional to each other. That is, the greater the quantization scale is, the smaller the amount of generated coded data becomes. Thus, the quantization scale is adjusted to control the is amount of generated coded data in a bitstream.
Heretofore, the quantization scale factor is adjusted as follow: First, a video signal is DCT-processed, the resulting DCT coefficients are quantized and variable-length coded. The amount of coded data generated through the variable-length coding is calculated. A comparison is made on a frame or block basis between a preset target amount of coded data and the calculated amount of coded data. The quantization scale factor is determined based on the result of the comparison and updated. Thus, in the prior art, the amount of generated coded data is compared with the target amount of coded data to determine a quantization scale factor to be used in the quantization process. Here, the amount of generated coded data corresponds to the actual amount of variable-length coded data to be output from the encoder as a result of DCT processing, quantization of DCT coefficients and subsequent variable-length coding of quantized DCT coefficients.
As described above, with the conventional method, the actual amount of generated coded data is first determined, and then the quantization scale factor is updated accordingly. Therefore, the video signal processing and the variable-length coding cannot be carried out concurrently, which results in the decreased speed of the overall process of coding a video signal.
It is an object of the present invention to provide a video coding device and method which allows signal processing and variable-length coding to be performed independently and in parallel and is adapted to fast and efficient processing.
According to an aspect of the present invention, there is provided a video coding device comprising:
setting means for setting a target amount of generated coded data in the bitstream;
performing means for performing DCT process on a unit of video information divided into blocks on a block-by-block basis to produce DCT coefficients;
quantizing means for quantizing the DCT coefficients in accordance with a predetermined quantization scale factor to produce quantized DCT coefficients;
coding means for variable-length coding the quantized DCT coefficients to produce a bitstream;
first counter configured to count the number of the quantized DCT coefficients output front the quantization means;
second counter configured to count the amount of generated coded data in the bitstream output from the coding means;
computation means for computing an average codeword length of the quantized DCT coefficients from the number of the quantized DCT coefficients from the first counter and the amount of generated coded data from the second counter; and
update means for computing an estimated value of the amount of coded data to be generated for the unit of information, from the average codeword length supplied from the computation means and the number of the quantized DCT coefficients supplied from the first counter, and updating the quantization scale factor in accordance with the target amount of generated coded data and the estimated amount of generated coded data.
According to another aspect of the present invention, there is provided a video coding device comprising:
transform means for performing DCT operations on a unit of video information divided into blocks on a block-by-block basis to produce DCT coefficients;
quantization means for quantizing the DCT coefficients in accordance with a predetermined quantization scale factor to produce quantized DCT coefficients;
set means for setting a target number of quantized DCT coefficients for the unit of video information;
coding means for variable-length coding the quantized DCT coefficients to produce a bitstream;
first counter configured to count the actual number of quantized DCT coefficients output from the quantization means;
second counter configured to count the amount of generated coded data in the bitstream output from the coding means;
average codeword length computation means for computing an average codeword length of the quantized DCT coefficients from the number of the quantized DCT coefficients from the first counter and the amount of generated coded data from the second counter;
target quantized DCT coefficient computation means for computing the target number of the quantized DCT coefficients that is expected to be counted by the first counter on the basis of the target number of the target quantized DCT coefficients; and
update means for updating the quantization scale factor in accordance with the actual number of the quantized DCT coefficients and the target number of the quantized DCT coefficients and sending the updated quantization scale factor to the quantization means.
According to still another aspect of the present invention, there is provided a video coding method, comprising steps of:
setting a target amount of generated coded data;
performing DCT operations on a unit of video information divided into blocks on a block-by-block basis to produce DCT coefficients;
quantizing the DCT coefficients in accordance with a predetermined quantization scale factor to produce quantized DCT coefficients;
variable-length coding the quantized DCT coefficients to produce a bitstream;
counting the number of the quantized DCT coefficients output by the quantization step;
counting the amount of generated coded data in the bitstream output by the coding step;
computing an average codeword length of the quantized DCT coefficients from the number of the quantized DCT coefficients obtained by the first counting step and the amount of generated coded data obtained by the second counting step; and
computing an estimated value for the amount of generated coded data for the unit of information from the average codeword length and the number of the quantized DCT coefficients and updating the quantization scale factor in accordance with the target amount of generated coded data and the estimated amount of generated coded data.
According to a further aspect of the present invention, there is provided a video coding method, comprising the steps of:
performing DCT operations on a unit of video information divided into blocks on a block-by-block basis to produce DCT coefficients;
quantizing the DCT coefficients in accordance with a predetermined quantization scale factor to produce quantized DCT coefficients;
setting a target number of quantized DCT coefficients for the unit of video information;
variable-length coding the quantized DCT coefficients to produce a bitstream;
counting the number of actual quantized DCT coefficients output by the quantization step;
counting the amount of generated coded data in the bitstream output by the coding step;
computing an average codeword length of the quantized DCT coefficients from the number of the quantized DCT coefficients and the amount of generated coded data;
computing the target number of the quantized DCT coefficients that is expected to be counted by the first-mentioned counting step on the basis of the target number of quantized DCT coefficients; and
updating the quantization scale factor in accordance with the actual number of the quantized DCT coefficients and the target number of the quantized DCT coefficients and sending the updated quantization scale factor to the quantization step.
In the above configurations, since the quantization scale factor can be controlled based on the number of the quantized DCT coefficients which are obtained from the each block after the each block being signal processed and before the each block being variable-length coded, the signal processing and the variable-length coding can be carried out independently and in parallel, allowing the overall processing to be speeded up and the amount of generated coded data to be controlled properly.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.